home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
dev
/
asm
/
ESA.readme
< prev
next >
Wrap
Text File
|
2002-10-26
|
2KB
|
52 lines
Short: Extended Syntax Assembly 1.15
Author: bevilacq@cli.di.unipi.it (Simone Bevilacqua)
Uploader: bevilacq@cli.di.unipi.it (Simone Bevilacqua)
Type: dev/asm
Requires: 020+ CPU, KS 2.04
Replaces: dev/asm/ESA.lha
Ever heard of "inline assembly" inside C, Pascal, etc. ?
Well, now we can have "inline C, Pascal, etc." inside assembly!
Look below: that's a small sample of ESA code!!!
*******************************************************************************
* CpyQtdStr
*******************************************************************************
* INFO copies a string enclosed between two quotes.
* SYN StrEnd = CpyQtd[StrPtr,DstBufAdr]
* d0.l a0.l a1.l
* IN StrPtr pointer to string
* DstBufAdr address of destination buffer
* OUT StrEnd pointer to last character (NULL); 0 if ERROR!
* WARN be careful there is *no* check!!!
* NOTE - the first char of the string is considered the quote
* - the copy is NULL-terminated;
* - fails at the first NEWLINE or BLANK
*******************************************************************************
function CpyQtdStr[a0-a1],d1/a0-a1:d0.l
move.b (a0)+,d0 ;get "quote"
repeat
move.b (a0)+,d1 ;get first char
switch.s d1.b
-> d0 ;successful copy
clr.b (a0) ;NULL-termination
moveq.l #0,d1 ;exit loop
-> #0 ;unvalid character, exit loop
suba.l a0,a0 ;error
-> #10 ;unvalid character
moveq.l #0,d1 ;exit loop
suba.l a0,a0 ;error
def
move.b d1,(a1)+ ;copy character
eswitch
until.s ~d1.b
efunc,a0 ;return new string pointer